#ifndef _libdbus_cpp_low_level_connection_h_
#define _libdbus_cpp_low_level_connection_h_

#include <boost/utility.hpp>
#include <libdbus-cpp/exception.h>

extern "C" {
#include <dbus/dbus.h>
} // extern C

namespace dbus {
namespace lowlevel {

class Connection : private boost::noncopyable {
protected:
  enum e_bustype {SystemBus,SessionBus};

	void InternalInit();

	DBusConnection* m_connection;
	DBusError m_error;
public:
	Connection(e_bustype type=SessionBus);
	Connection(const std::string& bus_addr); // To Named Bus

  virtual ~Connection();

};


// convenience classeS
class SystemBusConnection : public Connection {
public:
	SystemBusConnection() : Connection(Connection::SystemBus) {};
};

class SessionBusConnection : public Connection {
	SessionBusConnection() : Connection(Connection::SessionBus) {};
};


} // namespace lowlevel
} // namespace dbus

#endif // _libdbus_cpp_low_level_connection_h_
